<!-- 会员, 查看自己的某次健康档案记录 -->
<template>
	<view class="main-con">
		<cu-custom bgColor="bg-E96141" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">{{healthRecordDate}}健康档案详情</block>
		</cu-custom>
		<form>
			<view class="cu-form-group">
				<view class="title">姓名</view>
				{{myFormData.name}}
			</view>
			<view class="cu-form-group">
				<view class="title">性别</view>
				{{myFormData.sex=='1'?'男':'女'}}
			</view>
			<view class="cu-form-group margin-top">
				<view class="title">省市区县</view>
				{{myFormData.address}}
			</view>
			<view class="cu-form-group">
				<view class="title">详细住址</view>
				{{myFormData.addressDetail}}
			</view>
			<view class="cu-form-group">
				<view class="title">出生日期</view>
				{{myFormData.birthday}}
			</view>
			<view class="cu-form-group">
				<view class="title">身份证号</view>
				{{myFormData.identity}}
			</view>
				
			<view class="cu-form-group margin-top">
				<view class="title">大便隐血</view>
				{{myFormData.dabianyinxue}}
			</view>
			<view class="cu-form-group">
				<view class="title">过敏史</view>
				{{myFormData.gms}}
			</view>
			<view class="cu-form-group">
				<view class="title">甲乙型流感</view>
				{{myFormData.jiayiliugan}}
			</view>
			<view class="cu-form-group">
				<view class="title">既往史</view>
				{{myFormData.jws}}
			</view>	
			<view class="cu-form-group">
				<view class="title">家族史</view>
				{{myFormData.jzs}}
			</view>
			<view class="cu-form-group">
				<view class="title">脉搏</view>
				{{myFormData.maibo}}
			</view>			
			<view class="cu-form-group">
				<view class="title">尿酸</view>
				{{myFormData.niaosuan}}umol/L
			</view>
			<view class="cu-form-group">
				<view class="title">皮肤</view>
				{{myFormData.pifu}}
			</view>
			<view class="cu-form-group">
				<view class="title">四肢活动</view>
				{{myFormData.sizhihl}}
			</view>
			<view class="cu-form-group">
				<view class="title">特殊处理</view>
				{{myFormData.teshuchuli}}
			</view>
		<!-- 	<view class="cu-form-group">
				<view class="title">糖化血红蛋白</view>
				{{myFormData.thxhdb ? '正常': ''}}
			</view> -->
			<view class="cu-form-group">
				<view class="title">听力</view>
				{{myFormData.tingli}}
			</view>
			<view class="cu-form-group">
				<view class="title">体温</view>
				{{myFormData.tiwen}}
			</view>
			<view class="cu-form-group">
				<view class="title">心电图</view>
				{{myFormData.xindianjiance}}
			</view>
			<view class="cu-form-group">
				<view class="title">心肺听诊</view>
				{{myFormData.xinfeitingzhen}}
			</view>
			<view class="cu-form-group">
				<view class="title">血糖</view>
				{{myFormData.xuetang}}
			</view>
			<view class="cu-form-group">
				<view class="title">血压</view>
				{{myFormData.xueya}}mmHg
			</view>
			<view class="cu-form-group">
				<view class="title">血脂</view>
				{{myFormData.xuezhi}}
			</view>
			<view class="cu-form-group">
				<view class="title">饮食评估</view>
				{{myFormData.yingshipinggu}}
			</view>
			<view class="cu-form-group">
				<view class="title">幽门螺旋杆菌</view>
				{{myFormData.ymlxgj}}
			</view>
			<view class="cu-form-group">
				<view class="title">语言</view>
				{{myFormData.yuyan}}
			</view>
			
			<view class="cu-form-group margin-top" style="display: flex;flex-direction: column;">
				<view class="title">检查报告</view>
				<block v-for="(item,index) in imagelist" :key="index" >
					<image :src="item" mode="aspectFill"/>
				</block>				
			</view>
			
		<!-- 	<view class="bg-img" v-for="(item,index) in imagList" :key="index"  :data-url="imagList[index]">
				<image :src="imagList[index]" mode="aspectFill"></image>
			</view> -->
			
			<view class="cu-form-group margin-top">
				<view class="title">医生签字</view>
				{{myFormData.doctor}}
			</view>
			<view class="cu-form-group">
				<view class="title">护士签字</view>
				{{myFormData.nurse}}
			</view>
			
			<view class="padding flex flex-direction bottom-btn-con">
				<button class="cu-btn bg-blue lg" 
					style="background-color: #E96141;" 
					@click="onGoBack">返回</button>
			</view>
			
		</form>
	</view>
</template>

<script>
	
	export default {
		name: "memberHealthRecordDetail",
		data() {
			return {
				healthRecordId: '',		//健康档案ID
				healthRecordDate: '',	//		  创建时间
				imagelist: [],  //检查报告
				index: -1,
				switchC: true,
				imgList: [],
				uploadUrl:"/sys/common/upload",
				myFormData:{
					memberUserAccount: '',
					name: '',
					sex: '',
					address: '',
					addressDetail: '',
					birthday: '',
					identity: '',
					dabianyinxue: '',
					doctor: '',
					fubujiancha: '',
					gms: '',
					huxi: '',
					jiayiliugan: '',
					jws: '',
					jzs: '',
					maibo: '',
					neike: '',
					niaosuan: '',
					nurse: '',
					pifu: '',
					sizhihl: '',
					teshuchuli: '',
					tgjc: '',
					thxhdb: '',
					tingli: '',
					tiwen: '',
					xindianjiance: '',
					xinfeitingzhen: '',
					xuetang: '',
					xueya: '',
					xueyang: '',
					xuezhi: '',
					yingshipinggu: '',
					ymlxgj: '',
					yuyan: '',
				},
			};
		},
		onLoad: function (option) {
			this.healthRecordId = option.id?option.id:''
			this.healthRecordDate = option.createDate?option.createDate:''
			if(this.healthRecordId){
				this.loadDetail()
			}
			
		},
		computed: {
		},
		methods: {		
			
			//查看详情
			loadDetail(){
				uni.showLoading({
					title:'加载中...',
					mask:true
				})
				let _params = {
					id:this.healthRecordId
				}
				let that = this
				that.$http.get("/health/jkda/queryById",{params:_params}).then(res=>{
					if(res.data.success){
						uni.hideLoading()
						that.myFormData = res.data.result
						that.imagelist=that.myFormData.thxhdb.split(",")
					}else{
						uni.hideLoading()
					}
				}).catch(err => {
					uni.hideLoading()
				});
			},
			//返回
			onGoBack() {
				uni.navigateBack({
					delta: 1
				})
			},
		}
	}
</script>

<style>
	.main-con{
		height: auto;
		overflow: hidden;
		border: 0px solid #f00;
		padding-bottom: 170upx;
	}
	.cu-form-group .title {
		min-width: calc(4em + 15px);
	}
	.bottom-btn-con{
		width: 100%;
		position: fixed; 
		bottom: 0; 
		background-color: #ffffff;
		box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.06);
	}
</style>
